package com.bush.mall.product.controller;

import org.springframework.web.bind.annotation.*;
import com.bush.mall.common.entity.Result;;
import com.bush.mall.product.entity.SpuInfoDescEntity;
import com.bush.mall.product.service.SpuInfoDescService;
import javax.annotation.Resource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * spu信息介绍
 * @author RUN
 * @date 2022-11-28
 */
@RestController
@RequestMapping("spuinfodesc")
@Api(tags = "spu信息介绍管理" )
public class SpuInfoDescController {

    @Resource(name= SpuInfoDescService.BEAN_ID)
    private SpuInfoDescService spuInfoDescService;

    /**
     * 分页查询spu信息介绍列表
     * @author RUN
     * @date 2022-11-28
     */
    @ApiOperation(value = "分页查询spu信息介绍列表")
    @GetMapping("queryForPage")
    public Result queryForPage(Integer current,Integer size){
        return spuInfoDescService.queryForPage(current,size);
    }

    /**
     * 保存spu信息介绍表单
     * @author RUN
     * @date 2022-11-28
     */
    @ApiOperation(value = "保存spu信息介绍表单")
    @PostMapping("saveSpuInfoDesc")
    public Result saveSpuInfoDesc(@RequestBody SpuInfoDescEntity spuInfoDesc){
        return spuInfoDescService.saveSpuInfoDesc(spuInfoDesc);
    }

    /**
     * 修改spu信息介绍表单
     * @author RUN
     * @date 2022-11-28
     */
    @ApiOperation(value = "修改spu信息介绍表单")
    @PutMapping("updateSpuInfoDesc")
    public Result updateSpuInfoDesc(@RequestBody SpuInfoDescEntity spuInfoDesc){
        return spuInfoDescService.updateSpuInfoDesc(spuInfoDesc);
    }

    /**
     * 通过指定id删除spu信息介绍
     * @author RUN
     * @date 2022-11-28
     */
    @ApiOperation(value = "通过指定id删除spu信息介绍")
    @DeleteMapping("deleteSpuInfoDesc")
    public Result deleteSpuInfoDesc(Long id){
        return spuInfoDescService.deleteSpuInfoDesc(id);
    }

}
